//
//  FiddleListTableViewCell.m
//  MGPolymerAdSDK_Example
//
//  Created by 虞嘉伟 on 2025/1/7.
//  Copyright © 2025 790879770@qq.com. All rights reserved.
  

#import "FiddleListTableViewCell.h"
#import <Masonry/Masonry.h>

@interface FiddleListTableViewCell ()
//@property (nonatomic, strong) UIImageView *icon;
//@property (nonatomic, strong) UILabel *titleLabel;
//@property (nonatomic, strong) UILabel *briefLabel;
@end
@implementation FiddleListTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self.contentView addSubview:self.icon];
        [self.contentView addSubview:self.titleLabel];
        [self.contentView addSubview:self.briefLabel];
        
        [self.icon mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self.contentView).offset(14);
            make.width.mas_equalTo(40);
            make.height.mas_equalTo(50);
            make.centerY.equalTo(self.contentView);
        }];
        [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self.icon.mas_right).offset(10);
            make.right.equalTo(self.contentView).inset(14);
            make.top.equalTo(self.icon).offset(2);
            make.height.mas_equalTo(20);
        }];
        [self.briefLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self.titleLabel);
            make.right.equalTo(self.contentView).inset(14);
            make.top.equalTo(self.titleLabel.mas_bottom).offset(4);
            make.height.mas_equalTo(20);
        }];
    }
    return self;
}

- (UIImageView *)icon {
    if (!_icon) {
        _icon = [UIImageView new];
        _icon.contentMode = UIViewContentModeScaleAspectFit;
    }
    return _icon;
}
- (UILabel *)titleLabel {
    if (!_titleLabel) {
        _titleLabel = [UILabel new];
        _titleLabel.font = [UIFont systemFontOfSize:14];
    }
    return _titleLabel;
}
- (UILabel *)briefLabel {
    if (!_briefLabel) {
        _briefLabel = [UILabel new];
        _briefLabel.font = [UIFont systemFontOfSize:10 weight:UIFontWeightLight];
    }
    return _briefLabel;
}
@end
